 /*
 * cuaCircular.c
 *
 *  Created on: 27/09/2011
 *      Author: Xavier Lagunas Calp<xlagunas@gmail.com>
 */

#include <stdio.h>

#define MAX_MOSTRES 16
#define modul2(value,pos) {vector[pos]=value; pos = (pos+1) & (MAX_MOSTRES-1); }
#define addSample(value) {vector[pos_input]=value; pos_input = (pos_input+1) & (MAX_MOSTRES-1); }

int vector[MAX_MOSTRES];
int pos_input = 0;

int main(int arg,char **argv){
	int i=0;

	for(i=0;i<55;i++){
		addSample(i);
	}
	for (i=0;i<MAX_MOSTRES;i++){
		printf("Valor del vector: V[%d] = %d.\n",i,vector[i]);
	}
	return 1;
}
